package com.sky.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 数据统计模块持久层接口
 */
@Mapper
public interface ReportMapper {
    /**
     * 统计营业额，此时要求必须是完成的订单才参与统计
     *
     * @param dateStr
     * @return
     */
    @Select("select sum(amount) from orders " +
            "where status = 5 " +
            "and date_format(order_time,'%Y-%m-%d') = #{dateStr}")
    Double sumByDate(String dateStr);
}
